//@author A0101291X
#include "guidialog.h"
#include "ui_guidialog.h"

GUIDialog::GUIDialog(QWidget *parent) : QDialog(parent), dialog(new Ui::GUIDialog) {
    dialog->setupUi(this);
	setComponents();
	setHelpText();
	initialiseShortcuts();
}

GUIDialog::~GUIDialog() {
    delete dialog;
}

void GUIDialog::setComponents() {
	setWindowTitle("PowerSchedule Help");
	
}

void GUIDialog::setHelpText() {
	image.load(":/IconFiles/Resources/PowerSchedule Help.png");
	image = image.scaled(dialog->infoLabel->size(), Qt::KeepAspectRatio);
	dialog->infoLabel->setPixmap(image);
}

void GUIDialog::initialiseShortcuts() {
	new QShortcut(Qt::Key_F1, this, SLOT(closeHelp()));
}

void GUIDialog::closeHelp() {
	this->hide();
}